<div class="full_w">
    <div class="h_title"><?php echo Yii::t('AdmincpModule.admincp', 'Add Category'); ?></div>
    <form action="" method="post">
        <div class="element">
            <label for="name">Code: <span class="red">(required)</span></label>
            <input type="text" name="categoryForm[category_code]" id="code" class="text required" value="<?php echo isset($arrItemInfo['category_code'])?$arrItemInfo['category_code']:null; ?>">
        </div>
        <div class="element">
            <label for="name">Name: <span class="red">(required)</span></label>
            <input type="text" name="categoryForm[category_name]" id="name" class="text required" value="<?php echo isset($arrItemInfo['category_name'])?$arrItemInfo['category_name']:null; ?>">
        </div>
        <div class="element">
            <label for="name">Description:</label>
            <textarea name="categoryForm[category_description]" class="textarea" id="intro"><?php echo isset($arrItemInfo['category_description'])?$arrItemInfo['category_description']:null; ?></textarea>
        </div>
        <div class="element">
            <label for="category">Category:</label>
            <select name="categoryForm[category_parent]" id="parent">
                <option value="">None</option>
                <?php foreach($arrCategories as $R): ?>
                <option value="<?php echo $R['category_id']; ?>" <?php if(isset($arrItemInfo['category_parent']) && $R['category_id'] == $arrItemInfo['category_parent']): ?>selected<?php endif; ?>>
                    <?php for($i=0; $i<$R['category_level']; $i++): echo '&nbsp;&nbsp;&nbsp;'; endfor; ?>
					<?php echo $R['category_name']; ?>
                </option>
                <?php endforeach; ?>
            </select>
        </div>
        <div class="entry">
            <input type="hidden" name="id" id="id" value="<?php echo isset($arrItemInfo['category_id'])?$arrItemInfo['category_id']:null; ?>">
            <button type="submit">Preview</button> <button type="submit" class="add">Save</button> <button class="cancel">Cancel</button>
        </div>
    </form>
</div>